function closeLayer() {
    //var index = parent.layer.getFrameIndex(window.name);
    //parent.layer.close(index);
    parent.layer.closeAll();
}

var url = '';
function initLayer() {
    //点取消关闭弹窗
    $('.cancel').click(function () {
        closeLayer();
    });

    //默认第一个部门选中
    $(function () {
        $('.people_left ul li:first').addClass('pe');
    })

    //点击部门获取人员
    $('.people_left ul li').on('click', function () {
        url = $(this).children().attr('data-url');
        var id = $('input[name="flow_id"]').val();
        $(this).addClass('pe').siblings().removeClass('pe');
        getData(1);
    })

    //全部选中
    $('.add-all').on('click', function () {
        var form_id = $('input[name=id]').val();
        var table_key = $('input[name="table_key"]').val();  //layer.html页面传过来的key
        var flow_type = $('#flow_type').val();  //设计流程中的自动选人 2018/7/11 by zyh
        $('.select_peo ul li .c-name').addClass('checked');

        var userId = new Array();
        var userName = new Array();
        $('.select_peo ul li').each(function () {
            userId.push($(this).attr('data-id'));
            userName.push($(this).children('span').text());
        })

        if (form_id != 0) {
            //工作计划中的全选
            tabName = '.addUser_' + form_id;
            var html = '<span></span>';
            for (var i = 0; i < userId.length; i++) {
                html += '<span class="one-name"><a>' + userName[i] + '</a>';
                html += '<img class="pointer delOperator" data-id="' + userId[i] + '" src="/Public/Index/img/close_red.png" alt="close" width="12"/>';
                html += '<input type="hidden"';
                if (table_key != 0) {
                    html += 'name="' + table_key + '[]"';
                } else {
                    html += 'name="user_ids[]"';
                }
                html += 'value="' + userId[i] + '">';
                html += '<input type="hidden" name="user_names[]" value="' + userName[i] + '"></span>';
            }
            parent.$(tabName).parent('.value').find('.textarea').html(html);
        } else if (flow_type != 0) {
            //流程设计中的全选 2018/7/11 by zyh
            var html = '<span></span>';
            for (var i = 0; i < userId.length; i++) {
                html += '<span class="one-name"><a>' + userName[i] + '</a>';
                html += '<img class="pointer delOperator" data-id="' + userId[i] + '" src="/Public/Index/img/close_red.png" alt="close" width="12"/>';
                html += '<input type="hidden"';
                if (table_key != 0) {
                    html += 'name="' + table_key + '[]"';
                } else {
                    html += 'name="user_ids[]"';
                }
                html += 'value="' + userId[i] + '">';
                html += '<input type="hidden" name="user_names[]" value="' + userName[i] + '"></span>';
            }
            parent.$('.auto_user').html(html);
        } else {
            //流程中的全选
            var html = '<p class="people main_user"><span class="one">主办人：</span></p>';
            html += '<p class="other_user"><span class="one">经办人：</span>';
            for (var i = 0; i < userId.length; i++) {
                html += '<span><a>' + userName[i] + '</a>';
                html += '<img class="pointer delOperator" data-id="' + userId[i] + '" src="/Public/Index/img/close_red.png" alt="close" width="12" />';
                html += '<input type="hidden" name="user_ids[]" value="' + userId[i] + '">';
                html += '<input type="hidden" name="user_names[]" value="' + userName[i] + '"></span>';
            }
            html += '</p>';
            parent.$('.operator').html(html);
        }
    })

    //全部删除
    $('.add-del').on('click', function () {
        var form_id = $('input[name=id]').val();
        var flow_type = $('#flow_type').val();  //设计流程中的自动选人 2018/7/11 by zyh
        //$('.select_peo ul li').css({'background': 'none', 'color': '#000'});
        $('.select_peo ul li label,span').removeClass('checked');
        $('.select_peo ul li label img').attr('src', '/Public/Index/img/s2.png')
        if (form_id != 0) {
            tabName = '.addUser_' + form_id;
            parent.$(tabName).parent('.value').find('.textarea span:not(:first)').remove();
        } else if (flow_type != 0) {
            //流程设计中的全选 2018/7/11 by zyh
            parent.$('.auto_user span:not(:first)').remove();
        } else {
            //流程中的全删
            parent.$('.operator .main_user span:not(:first),.other_user span:not(:first)').remove();
        }
    })

    //选中经办人
    $('body').on('click', '.c-name', function () {
        var id = $(this).parent('li').attr('data-id');  //user_id
        var form_id = $('input[name="id"]').val();  //layer.html页面传过来的id
        var name = $(this).text();
        var table_key = $('input[name="table_key"]').val();  //layer.html页面传过来的key
        var flow_type = $('#flow_type').val();  //设计流程中的自动选人 2018/7/11 by zyh
        var one = $('#one').val();  //流程查询中的自动选人，默认只能选项一个，且没有X
        var form = $('#form').val();
        if ($(this).attr('class') == 'c-name') {
            $(this).addClass('checked');
            var html = '<span class="one-name"><a>' + name + '</a>';
            if (one == 0) {
                html += '<img class="pointer delOperator" data-id="' + id + '" src="/Public/Index/img/close_red.png" alt="close" width="12"/>';
            }else{
                $(this).parent().siblings().children('span').removeClass('checked');
            }
            html += '<input type="hidden"';
            if (table_key != 0) {
                html += 'name="' + table_key + '[]"';
            } else {
                html += 'name="user_ids[]"';
            }

            html += 'value="' + id + '">';
            html += '<input type="hidden" name="user_names[]" value="' + name + '"></span>';
            if (form_id != 0) {
                //工作计划中的选择人员
                tabName = '.addUser_' + form_id;
//                alert(tabName);
                parent.$(tabName).parent('.value').find('.textarea span:last').after(html);
                parent.$(tabName).parent('.search').find('.textarea span:last').after(html);
            } else if (flow_type != 0) {
                //流程中设计流程自动选人
                parent.$('.auto_user span:last').after(html);
            } else if (one == 1) {
                //流程查询中的自动选人
                parent.$('#user').children('div,span').html(html);
            } else if (form == 1){
                //流程表单中增加选择人员控件
                parent.$('body').find('.auto_user img:last').after(html)
            }else{
                //流程中的选择人员
                parent.$('.operator .other_user span:last').after(html);
            }

        } else {
            $(this).removeClass('checked');
            if (form_id != 0) {
                //工作计划中的选择人员
                parent.$(tabName).parent('.value').find('.textarea span').each(function () {
                    if (name == $(this).text()) {
                        $(this).remove();
                    }
                })
            } else if (flow_type != 0) {
                //流程中设计流程自动选人
                parent.$('.auto_user span').each(function () {
                    if (name == $(this).text()) {
                        $(this).remove();
                    }
                })
            } else {
                //流程中的选择人员
                parent.$('.operator .other_user span').each(function () {
                    if (name == $(this).text()) {
                        $(this).remove();
                    }
                })
            }

        }

    })

    //选中主办人
    $('body').on('click', '.c-img', function () {
        var id = $(this).parents('li').attr('data-id');
        var name = $(this).parent().next().text();
        var flow_type = $('#flow_type').val();  //设计流程中的自动选人 2018/7/11 by zyh
        if ($(this).attr('src') == '/Public/Index/img/s2.png') {
            $(this).attr('src', '/Public/Index/img/s1.png');
            $(this).parent('label').addClass('checked');
            $(this).parents('li').siblings().find('.c-img').attr('src', '/Public/Index/img/s2.png')
            $(this).parents('li').siblings().find('label').removeClass('checked')

            var html = '<span class="one-name"><a>' + name + '</a>';
            html += '<img class="pointer delOperator" data-id="' + id + '" src="/Public/Index/img/close_red.png" alt="close" width="12"/>';
            html += '<input type="hidden" name="user_id" value="' + id + '">';
            html += '<input type="hidden" name="user_name" value="' + name + '"></span>';

            if (flow_type != 0) {
                //设计流程中的主办人 2018/7/11 by zyh
                parent.$('.auto_user_op').html(html);
            } else {
                //流程中的主办人
                if (parent.$('.operator .main_user span:last').text() == '主办人：') {
                    parent.$('.operator .main_user span:last').after(html);
                } else {
                    parent.$('.operator .main_user span:last').remove();
                    parent.$('.operator .main_user span:last').after(html);
                }
            }

        } else {
            $(this).attr('src', '/Public/Index/img/s2.png')
            $(this).parent('label').removeClass('checked');
            if (flow_type != 0) {
                //设计流程中的主办人 2018/7/11 by zyh
                parent.$('.auto_user_op').html('');
            } else {
                //流程中的主办人
                parent.$('.operator .main_user span').each(function () {
                    if (name == $(this).text()) {
                        $(this).remove();
                    }
                })
            }

        }
    })

    //确定（判断是否选择人员后关闭）
    $('.submitRole').on('click', function () {
        var id = $('input[name="flow_id"]').val();
//        if (id != 0) {
//            if (parent.$('.operator .main_user span:last a').text() != '' || (parent.$('.operator .other_user span:last a').text() != '')) {
//                $('.cancel').click();
//            } else {
//                layer.msg('请选择至少一位用户');
//            }
//        } else {
        closeLayer();
//        }
    })

    //确定部门
    $('.submitDept').on('click', function () {
        closeLayer();
    })

    //提交回退流程
    $('.submitBack').on('click', function () {
        var url = $('.flow2 li').find('input:checked').next().attr('data-url');
        $.get(url, function (res) {
            console.log(res)
            layer.msg = res.info;
            parent.location.href = res.url;
        })
    })

    //选择部门
    $('.all-line').on('click', function () {
        id = $(this).parent('li').attr('data-id');
        name = $(this).text();
        if ($('#field').val()) {
            var fieldName = $('#field').val();
        } else {
            var fieldName = 'dept_ids';
        }
        if ($(this).parent('li').attr('class') == 'pointer') {
            $(this).parent('li').addClass('checked');
            var html = '<span><a>' + name + '</a>';
            html += '<img class="pointer delOperator" data-id="' + id + '" src="/Public/Index/img/close_red.png" alt="close" width="12"/>';
            html += '<input type="hidden" name="' + fieldName + '[]" value="' + id + '">';
            html += '<input type="hidden" name="dept_names[]" value="' + name + '"></span>';
            parent.$('.depart').children('span:last').after(html);

        } else {
            $(this).parent('li').removeClass('checked');
            parent.$('.depart span').each(function () {
                if (name == $(this).text()) {
                    $(this).remove();
                }
            })
        }
    })

    //全部添加 部门
    $('.add-all-dept').on('click', function () {
        $('.select_peo ul li').addClass('checked');

        if ($('#field').val()) {
            var fieldName = $('#field').val();
        } else {
            var fieldName = 'dept_ids';
        }

        var deptId = new Array();
        var deptName = new Array();
        $('.select_peo ul li').each(function () {
            deptId.push($(this).attr('data-id'));
            deptName.push($(this).children('span').text());
        })

        var html = '<span>';
        for (var i = 0; i < deptId.length; i++) {
            html += '<span><a>' + deptName[i] + '</a>';
            html += '<img class="pointer delOperator" data-id="' + deptId[i] + '" src="/Public/Index/img/close_red.png" alt="close" width="12"/>';
            html += '<input type="hidden" name="' + fieldName + '[]" value="' + deptId[i] + '">';
            html += '<input type="hidden" name="dept_names[]" value="' + deptName[i] + '"></span>';
        }
        html += '</span>';
        parent.$('.depart').html(html);
    })

    //全部删除
    $('.add-del-dept').on('click', function () {
        $('.select_peo ul li').removeClass('checked');
        parent.$('.depart span:not(:first)').remove();
    })

    //选择角色
    $('.all-line-priv').on('click', function () {
        var key = $('#key_id').val();
        id = $(this).parent('li').attr('data-id');
        name = $(this).text();
        var fieldName = $('#field').val();
        if ($(this).parent('li').attr('class') == 'pointer') {
            var html = '<span style=""><a>' + name + '</a>';
            html += '<img class="pointer delOperator" data-id="' + id + '" src="/Public/Index/img/close_red.png" alt="close" width="12"/>';
            html += '<input type="hidden" name="' + key + '[]" value="' + id + '">';
            html += '<input type="hidden" name="' + fieldName + '[]" value="' + id + '">';
            html += '<input type="hidden" name="priv_name[]" value="' + name + '"></span>';

            if (key) {
                tabName = '.addPriv_' + key;
            } else {
                tabName = '.addPriv';
            }

            if (fieldName == 'user_priv') {
                var len = parent.$(tabName).parent('.value').find('.textarea span').length;
                if (len > 1) {
                    layer.msg('主角色只能选择一个');
                    return;
                } else {
                    $(this).parent('li').addClass('checked');
                }
            } else {
                $(this).parent('li').addClass('checked');
            }
            if (key) {
                parent.$(tabName).parent('.value').find('.textarea span:last').after(html);
            } else {
                parent.$('.priv').children('span:last').after(html);
            }
        } else {
            $(this).parent('li').removeClass('checked');
            parent.$('.priv span').each(function () {
                if (name == $(this).text()) {
                    $(this).remove();
                }
            })
        }
    })

    //全部添加 角色
    $('.add-all-priv').on('click', function () {
        var key = $('#key_id').val();
        var fieldName = $('#field').val();

        $('.select_peo ul li').addClass('checked');

        var deptId = new Array();
        var deptName = new Array();
        $('.select_peo ul li').each(function () {
            deptId.push($(this).attr('data-id'));
            deptName.push($(this).children('span').text());
        })
        
        var html = '<span>';
        for (var i = 0; i < deptId.length; i++) {
            html += '<span style="padding:5px 10px 0 0"><a>' + deptName[i] + '</a>';
            html += '<img class="pointer delOperator" data-id="' + deptId[i] + '" src="/Public/Index/img/close_red.png" alt="close" width="12"/>';
            html += '<input type="hidden" name="' + fieldName + '[]" value="' + deptId[i] + '">';
            html += '<input type="hidden" name="priv_name[]" value="' + deptName[i] + '"></span>';
        }
        html += '</span>';
        if(key){
            tabName = '.addPriv_' + key;
            parent.$(tabName).parent('.value').find('.textarea span:last').after(html);
        }else{
            //公告、公文、新闻选择角色
            parent.$('.priv').html(html);
        }
        
    })

    //提交回复日志内容
    $('.submitReply').one('click', function () {
        var url = $(this).attr('data-url');
        var url1 = url.substring(url.lastIndexOf('/'), url.indexOf('/'));
        var url2 = url.substring(url1.lastIndexOf('/'), url1.indexOf('/'));
        var str = url.substring(url.lastIndexOf('/'), url.lastIndexOf('.'));
        var reg = /\d+/g;
        var ms = str.match(reg);
        var newurl = url2 + "/content/" + $(this).parent().siblings('div').find('textarea').val() + '/dia_id/' + ms + '.html';
        if ($(this).parent().siblings('div').find('textarea').val() == '') {
            layer.msg('请填写评论内容');
        } else {
            $.get(newurl, function (res) {
                console.log(res)
                var index = parent.layer.getFrameIndex(window.name);
                parent.layer.close(index);
                window.location.reload();
            })
        }
    })

    //提交评论日志内容 qiaoshoujuan
    $('.submitCommentDiary').one('click', function () {
        var url = $(this).attr('data-url');
        var url1 = url.substring(url.lastIndexOf('/'), url.indexOf('/'));
        var url2 = url.substring(url1.lastIndexOf('/'), url1.indexOf('/'));
        var str = url.substring(url.lastIndexOf('/'), url.lastIndexOf('.'));
        var reg = /\d+/g;
        var ms = str.match(reg);
        var newurl = url2 + "/CONTENT/" + $(this).parent().siblings('div').find('textarea').val() + '/DIA_ID/' + ms + '.html';
        if ($(this).parent().siblings('div').find('textarea').val() == '') {
            layer.msg('请填写评论内容');
        } else {
            $.get(newurl, function (res) {
                console.log(res)
                var index = parent.layer.getFrameIndex(window.name);
                parent.layer.close(index);
                parent.location.reload();
            })
        }
    })

    //提交回复新闻评论内容
    $('.submitReplyNews').one('click', function () {
        var content = $('#reply_content').val();
        var url = $(this).attr('data-url');
        if ($(this).parent().siblings('div').find('textarea').val() == '') {
            layer.msg('请填写评论内容');
        } else {
            $.get(url, {content: content}, function (res) {
                console.log(res)
                var index = parent.layer.getFrameIndex(window.name);
                parent.layer.close(index);
                parent.location.reload();
            })
        }
    })

    //提交回复日志评论内容
    $('.submitReplyDiary').one('click', function () {
        var content = $(this).parent().siblings('div').find('textarea').val();
        var url = $(this).attr('data-url');
        if (content == '') {
            layer.msg('请填写评论内容');
        } else {
            $.get(url, {content: content}, function (res) {
                console.log(res);
                var index = parent.layer.getFrameIndex(window.name);
                parent.layer.close(index);
                parent.location.reload();
            })
        }
    })

    $(function () {
        if ($('.people_main .content textarea').hasClass('feedback')) {
            var width = $('.content').width();
            var height = $('.content').height();
            var ue = UE.getEditor('content', {
                initialFrameWidth: width,
                initialFrameHeight: height,
                elementPathEnabled: false,
                workCount: false,
                toolbars: [[
                        "source", "undo", "redo", "insertunorderedlist", "insertorderedlist", "unlink", "link", "searchreplace", "preview", "pagebreak", "simpleupload", "insertimage", "emotion", "insertvideo", "attachment", "date", "time", "gmap", "map", "horizontal", "spechars", "pasteplain", "insertcode", "background", "bold", "italic", "underline", "strikethrough", "forecolor", "backcolor", "superscript", "subscript", "justifyleft", "justifycenter", "justifyright", "justifyjustify", "formatmatch", "removeformat", "lineheight", "fontfamily", "fontsize", "imagenone", "imageleft", "imageright", "imagecenter", "inserttable", "mergeright", "mergedown", "splittorows", "splittocols", "splittocells", "mergecells", "insertcol", "insertrow", "deletecol", "deleterow", "insertparagraphbeforetable", "charts"
                    ]],
            });
        }


        //计划批注提交
        $('.submitComment').one('click', function () {
            var url = $(this).attr('data-url');
            var data = {id: $('.plan_id').val(), content: ue.getContent(), lng: $('body').find('.lng').val(), lat: $('body').find('.lat').val()};
            console.log(data);
            var index = layer.load(2, {shade: false});
            $.post(url, data, function (res) {
                console.log(res);
                layer.msg(res.msg, {icon: res.icon});
                if (res.status) {
//                    layer.close(index);
//                    setTimeout(function () {
//                        closeLayer();
//                    }, 1000);
                    setTimeout("parent.location.reload()", 1000);
                } else {
//                    layer.msg(res.msg, {icon: res.icon});
                    layer.close(index);
                }
            })
        })
    })

    //提交周报回复
    $('.submitReplyWeekly').one('click', function () {
        var data = $('form').serialize();
        var url = $(this).attr('data-url');
        var index = layer.load(2, {shade: false});
        $.post(url, data, function (res) {
            if (res.status == 1) {
                layer.msg('回复成功', {icon: 6});
                parent.location.reload();
            } else {
                layer.msg('回复失败', {icon: 5});
                layer.close(index);
            }
            var index2 = parent.layer.getFrameIndex(window.name);
            parent.layer.close(index2);
        })
    })

    //审批不通过
    $('.noPass').on('click', function () {
        var value = $(this).val();
        if (value == 3) {
            $('.valid_textarea').show();
        } else {
            $('.valid_textarea').hide();
        }
    })

    //提交审批意思
    $('.submitVerify').one('click', function () {
        var publish = $('input[name=PUBLISH]:checked').val();
        var reason = $('#reason').val();
        if (publish == 3) {
            if (reason) {
                var data = $('form').serialize();
                var url = $(this).attr('data-url');
                var index = layer.load(2, {shade: false});
                $.post(url, data, function (res) {
                    console.log(res);
                    if (res) {
                        location.reload();
                        parent.location.reload();
                    } else {
                        layer.msg('提交失败', {icon: 5});
                    }
                    var index2 = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index2);
                })
            } else {
                layer.msg('请填写不批准的意见！');
            }
        } else {
            var data = $('form').serialize();
            var url = $(this).attr('data-url');
            var index = layer.load(2, {shade: false});
            $.post(url, data, function (res) {
                console.log(res);
                if (res) {
                    location.reload();
                    parent.location.reload();
                } else {
                    layer.msg('提交失败', {icon: 5});
                }
                var index2 = parent.layer.getFrameIndex(window.name);
                parent.layer.close(index2);
            })
        }


    })

    //按月份查询计划
    $('.checkMonth').on('click', function () {
        var month = $(this).attr('data-month');
        var url = $('#monthUrl').val();
        parent.location.href = url + '?month=' + month;
    })

    //提交管理权限
    $('.submitFlowPriv').one('click', function () {
        var url = $(this).attr('data-url');
        var data = $('#flowPriv').serialize();
        $.post(url, data, function (res) {
            var res = res;
            console.log(res);
            if (res.status) {
//                $('.cancel').click();
                var url = res.url;
                $.get(url, function (pres) {
                    console.log(pres);
                    var html = '';
                    html += '<tr><td>' + pres.priv_type + '</td>';
                    html += '<td class="auth-m">';
                    if (pres.user) {
                        html += '<p><b>用户：</b>' + pres.user + '</p>';
                    }
                    if (pres.dept) {
                        html += '<p><b>部门：</b>' + pres.dept + '</p>';
                    }
                    if (pres.role) {
                        html += '<p><b>角色：</b>' + pres.role + '</p>';
                    }
                    html += '</td>';
                    html += '<td>' + pres.priv_scope + '</td>';
                    html += '<td><a class="pointer editFlowPriv" data-id="' + pres.id + '">修改&nbsp;</a><a class="pointer delFlowPriv" data-id="' + pres.id + '">删除</a></td></tr>';

                    var len = parent.$('body').find('.auth tbody tr').length;
                    if (res.edit == 1) {
                        parent.$('.power-flow .auth tbody .editFlowPriv').each(function () {
                            if ($(this).attr('data-id') == pres.id) {
                                $(this).parents('tr').after(html);
                                $(this).parents('tr').remove();
                            }
                        })
                    } else if (len == 0) {
                        parent.$('.power-flow .auth tbody').html(html);
                    } else {
                        parent.$('.power-flow .auth tbody tr:last').after(html);
                    }

                    closeLayer();
                })

            } else {
                layer.msg(res.info, {'icon': res.icon})
            }

        })
    })

    //编辑物品类别
    $('.editGoodsCate').on('click', function () {
        $(this).parents('tr').children().find('span').hide();
        $(this).parents('tr').children().find('input').show();
    })

    //答复问题与建议
    $('.submitAdvice').click(function(){
        var document_w = $(window).width();
        var document_h = $(window).height();
        var layer_w = '550';
        var layer_h = '350';
        var w = (document_w - layer_w) / 2;
        var h = (document_h - layer_h) / 2;
        var id = $(this).attr('data-id');
        layer.open({
            type: 2,
            title: [
                "问题与建议",
                'background-color: #437dba;color:#fff;text-align:center;font-size:1.4em',
            ],
            area: [layer_w + 'px', layer_h + 'px'], //宽高
            offset: [h + 'px', w + 'px'], //弹出位置 [top,left]
            content: "/index.php/Home/Index/layer/type/19/id/"+id
        })
        
    })
    
    //删除问题
    $('.delQuestion').click(function(){
        var id = $(this).attr('data-id');
        var url = $(this).attr('data-url');
        var index = layer.getFrameIndex(window.name);
        layer.confirm('确定要进行此操作吗？', {
            closeBtn: 0,
            btn: ['确定', '取消'] //按钮
        }, function () {
            $.get(url,{id:id},function(res){
                console.log(res);
                layer.msg(res.info);
                location.reload();
            })
        })
    })

}

function getData(num) {
    url = url + '/p/' + num;
    var id = $('input[name=flow_id]').val();
    // var data = 'dept_id=' + dept_id + '&p=' + num;
    //var url = $('#url').val();
    $.ajax({
        url: url,
        type: 'get',
        typeData: 'json',
        success: function (res) {
            console.log(res);
            var html = '';
            var len = res.list.length;
            if (len > 0) {
                for (var i = 0; i < len; i++) {
                    if (res.list[0].checked && res.list.length == 1) {
                        html += '<li class="pointer" data-id="' + res.list[i].user_id + '">';
                        if (res.list[i].flow_id != 0) {
                            html += '<label class="checked"><img src="/Public/Index/img/s1.png" class="c-img" style="width:12px">主办</label> <span class="c-name checked">' + res.list[i].user_name + '</span></li>';
                        } else {
                            html += '<span class="c-name checked">' + res.list[i].user_name + '</span></li>';
                        }
                    } else if (res.list[0].checked) {
                        html += '<li class="pointer" data-id="' + res.list[i].user_id + '">';
                        if (res.list[i].flow_id != 0) {
                            html += '<label><img src="/Public/Index/img/s2.png" class="c-img" style="width:12px">主办</label> <span class="c-name checked">' + res.list[i].user_name + '</span></li>';
                        } else {
                            html += '<span class="c-name checked">' + res.list[i].user_name + '</span></li>';
                        }
                    } else {
                        html += '<li class="pointer" data-id="' + res.list[i].user_id + '">';
                        if (res.list[i].flow_id != 0) {
                            html += '<label><img src="/Public/Index/img/s2.png" class="c-img" style="width:12px">主办</label> <span class="c-name">' + res.list[i].user_name + '</span></li>';
                        } else {
                            html += '<span class="c-name">' + res.list[i].user_name + '</span></li>';
                        }
                    }

//                html += '<li class="pointer" data-id="' + res.list[i].user_id + '">';
//                if (res.list[i].flow_id != 0) {
//                    html += '<label><img src="/Public/Index/img/s2.png" class="c-img">主办</label>';
//                }
//                html += '<span class="c-name">' + res.list[i].user_name + '</span></li>';
                }
                //插入页码
                var page = '<div>';
                page += '<a class="pointer prev" onclick="getData(' + res.prev + ')" style="width:30px"><<</a>';
                for (var i = 0; i < res.page.length; i++) {
                    if (res.curr == res.page[i]) {
                        page += '<span class="current">' + res.page[i] + '</span>'
                    } else {
                        page += '<a class="pointer num" onclick="getData(' + res.page[i] + ')">' + res.page[i] + '</a>';
                    }
                }
                page += '<a class="pointer next" onclick="getData(' + res.next + ')" style="width:30px">>></a>';
                page += '</div>';
                $('.page').html(page);
            } else {
                html += '<li><span style="color:#bbb">没有符合条件的用户</span></li>';
            }
            $('.select_peo ul').html(html);
        }
    })
}
